{{#each customFields}}

    {{#if typeSubscriptionEmail}}
        <div class="form-group email">
            <label for="EMAIL">{{#translate}}emailAddress-2{{/translate}}</label>
            {{#if ../isManagePreferences}}
                <div class="input-group">
                    <input type="email" name="EMAIL" id="email" placeholder="" value="{{../email}}" readonly>
                    <div class="input-group-addon"><a href="/subscription/{{../lcid}}/manage-address/{{../cid}}">{{#translate}}wantToChangeIt?{{/translate}}</a></div>
                </div>
            {{else}}
                <input type="email" name="EMAIL" id="email" placeholder="" value="{{../email}}" required>
            {{/if}}
            <small class="form-text text-muted">{{help}}</small>
        </div>
    {{/if}}

    {{#if typeText}}
        <div class="form-group text {{key}}">
            <label for="{{key}}">{{name}}</label>
            <input type="text" name="{{key}}" value="{{value}}" {{#if required}} required {{/if}}>
            <small class="form-text text-muted">{{help}}</small>
        </div>
    {{/if}}

    {{#if typeNumber}}
        <div class="form-group number {{key}}">
            <label for="{{key}}">{{name}}</label>
            <input type="number" name="{{key}}" value="{{value}}" {{#if required}} required {{/if}}>
            <small class="form-text text-muted">{{help}}</small>
        </div>
    {{/if}}

    {{#if typeWebsite}}
        <div class="form-group url {{key}}">
            <label for="{{key}}">{{name}}</label>
            <input type="url" name="{{key}}" value="{{value}}" {{#if required}} required {{/if}}>
            <small class="form-text text-muted">{{help}}</small>
        </div>
    {{/if}}

    {{#if typeLongtext}}
        <div class="form-group longtext {{key}}">
            <label for="{{key}}">{{name}}</label>
            <textarea rows="3" name="{{key}}" {{#if required}} required {{/if}}>{{value}}</textarea>
            <small class="form-text text-muted">{{help}}</small>
        </div>
    {{/if}}

    {{#if typeJson}}
        <div class="form-group json {{key}}">
            <label for="{{key}}">{{name}}</label>
            <textarea class="gpg-text" rows="3" name="{{key}}" placeholder="{&quot;data&quot;:&quot;value&quot;}" {{#if required}} required {{/if}}>{{value}}</textarea>
            <small class="form-text text-muted">{{help}}</small>
        </div>
    {{/if}}

    {{#if typeOption}}
        <div class="form-group checkbox">
            <label>{{name}}</label>
            <label class="label-checkbox">
                <input type="checkbox" name="{{key}}" value="1" {{#if value}} checked {{/if}} {{#if required}} required {{/if}}> {{field.settings.checkedLabel}}
            </label>
            <input type="hidden" value="0" name="{{key}}">
            <small class="form-text text-muted">{{help}}</small>
        </div>
    {{/if}}

    {{#if typeGpg}}
        <div class="form-group gpg {{key}}">
            <label for="{{key}}">{{name}}</label>
            {{#if ../hasPubkey}}
                <button class="btn-download-pubkey" type="submit" form="download-pubkey">{{#translate}}downloadSignatureVerificationKey{{/translate}}</button>
            {{/if}}
            <textarea class="form-control gpg-text" rows="4" name="{{key}}" placeholder="{{#translate}}beginsWithAnd#39BeginPgpPublicKeyBloc{{/translate}}" {{#if required}} required {{/if}}>{{value}}</textarea>
            <small class="form-text text-muted">{{#translate}}insertYourGpgPublicKeyHereToEncrypt{{/translate}}</small>
            <small class="form-text text-muted">{{help}}</small>
        </div>
    {{/if}}

    {{#if typeDateUs}}
        <div class="form-group date fm-date-us {{key}}">
            <label for="{{key}}">{{name}}</label>
            <input type="text" name="{{key}}" placeholder="MM/DD/YYYY" value="{{value}}" {{#if required}} required {{/if}}>
            <small class="form-text text-muted">{{help}}</small>
        </div>
    {{/if}}

    {{#if typeDateEur}}
        <div class="form-group date fm-date-eur {{key}}">
            <label for="{{key}}">{{name}}</label>
            <input type="text" name="{{key}}" placeholder="DD/MM/YYYY" value="{{value}}" {{#if required}} required {{/if}}>
            <small class="form-text text-muted">{{help}}</small>
        </div>
    {{/if}}

    {{#if typeBirthdayUs}}
        <div class="form-group date fm-birthday-us {{key}}">
            <label for="{{key}}">{{name}}</label>
            <input type="text" name="{{key}}" placeholder="MM/DD" value="{{value}}" {{#if required}} required {{/if}}>
            <small class="form-text text-muted">{{help}}</small>
        </div>
    {{/if}}

    {{#if typeBirthdayEur}}
        <div class="form-group date fm-birthday-eur {{key}}">
            <label for="{{key}}">{{name}}</label>
            <input type="text" name="{{key}}" placeholder="DD/MM" value="{{value}}" {{#if required}} required {{/if}}>
            <small class="form-text text-muted">{{help}}</small>
        </div>
    {{/if}}

    {{#if typeDropdownGrouped }}
        <div class="form-group dropdown {{key}}">
            <label for="{{key}}">{{name}}</label>
            <select name="{{key}}" class="form-control" {{#if required}} required {{/if}}>
                <option value="">
                    {{#translate}}––Select ––{{/translate}}
                </option>
                {{#each options}}
                    <option value="{{key}}" {{#if value}} selected {{/if}}>{{name}}</option>
                {{/each}}
            </select>
            <small class="form-text text-muted">{{help}}</small>
        </div>
    {{/if}}

    {{#if typeRadioGrouped}}
        <div class="form-group radio {{key}}">
            <label for="{{key}}">{{name}}</label>
            {{#each options}}
                <label class="label-radio">
                    <input type="radio" name="{{../key}}" value="{{key}}" {{#if value}} checked {{/if}} {{#if required}} required {{/if}}> {{name}}
                </label>
            {{/each}}
            <small class="form-text text-muted">{{help}}</small>
        </div>
    {{/if}}

    {{#if typeCheckboxGrouped}}
        <div class="form-group checkbox">
            <input type="hidden" value="<present>" name="{{key}}">
            <label>{{name}}</label>
            {{#each options}}
                <label class="label-checkbox">
                    <input type="checkbox" name="{{key}}" value="1" {{#if value}} checked {{/if}} {{#if required}} required {{/if}}> {{name}}
                </label>
                <small class="option-help-block form-text text-muted">{{help}}</small>
            {{/each}}
        </div>
    {{/if}}

    {{#if typeDropdownEnum }}
        <div class="form-group dropdown {{key}}">
            <label for="{{key}}">{{name}}</label>
            <select name="{{key}}" class="form-control" {{#if required}} required {{/if}}>
                <option value="">
                    –– Select ––
                </option>
                {{#each options}}
                    <option value="{{key}}" {{#if value}} selected {{/if}}>{{name}}</option>
                {{/each}}
            </select>
            <small class="form-text text-muted">{{help}}</small>
        </div>
    {{/if}}

    {{#if typeRadioEnum}}
        <div class="form-group radio {{key}}">
            <label for="{{key}}">{{name}}</label>
            {{#each options}}
                <label class="label-radio">
                    <input type="radio" name="{{../key}}" value="{{key}}" {{#if value}} checked {{/if}} {{#if required}} required {{/if}}> {{name}}
                </label>
            {{/each}}
            <small class="form-text text-muted">{{help}}</small>
        </div>
    {{/if}}

{{/each}}
